package cate.common.table.activity.battleroyale.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cp.solution.util.str.Str;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

public class BattleRoyaleChapterRow extends ERow {
    public String unlockConsumeStr;

    public int expireSeconds;

    public int group;

    public int chapter;

    private String blessStr;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID");
        this.unlockConsumeStr = xrw.getString("解锁下一章消耗");
        this.expireSeconds = xrw.getInteger("持续时间", 86400);
        this.group = xrw.getInteger("活动分组");
        this.chapter = xrw.getInteger("章节");
        this.blessStr = xrw.getString("祝福ID");
    }

    public List<Integer> blessIds;

    @Override
    public void decode() {
        if(StringUtils.isNotBlank(blessStr)){
            blessIds = Str.strArr2intList(blessStr.split("#"));
        }
    }
}
